home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gtlayout / source / ltp_deleteobjectnode.c < prev    next >
C/C++ Source or Header  |  1999-04-19  |  733b  |  51 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. VOID
  17. LTP_DeleteObjectNode(LayoutHandle *handle,ObjectNode *node)
  18. {
  19.     struct Image **ImagePtr = NULL;
  20.  
  21.     switch(node->Type)
  22.     {
  23.         case PICKER_KIND:
  24.  
  25.             ImagePtr = &node->Special.Picker.Image;
  26.             break;
  27.  
  28.         case BUTTON_KIND:
  29.  
  30.             ImagePtr = &node->Special.Button.ButtonImage;
  31.             break;
  32.  
  33.         case INCREMENTER_KIND:
  34.  
  35.             ImagePtr = &node->Special.Incrementer.Image;
  36.             break;
  37.  
  38.         case TAPEDECK_KIND:
  39.  
  40.             ImagePtr = &node->Special.TapeDeck.ButtonImage;
  41.             break;
  42.     }
  43.  
  44.     if(ImagePtr)
  45.     {
  46.         DisposeObject(*ImagePtr);
  47.  
  48.         *ImagePtr = NULL;
  49.     }
  50. }
  51.